The VECTOR statement specifies hardware details about a device on the VME, GIO, or EISA bus, including iospace addresses, interrupt level, and an integer parameter. The VECTOR statement can specify a "probe" parameter that lets the kernel test for the existence of the specified hardware.
When the kernel processes a VECTOR statement during bootstrap and the probe is successful (or no probe is specified), the kernel stores the VECTOR parameters in a structure of type edt_t. (This structure is declared in sys/edt.h.)
Each time the kernel loads a driver that is named in a VECTOR statement, the kernel calls the driver's pfxedtinit() entry one time for each VECTOR statement that named that driver and had a successful probe (or that had no probe). VECTOR statements are processed in reverse sequence to the order in which they are coded in /var/sysgen/system files.
The prototype of the pfxedtinit() entry is
The edt_t contains at least the following fields (see the system(4) reference page for the corresponding VECTOR parameters):void pfxedtinit(edt_t *e);
e_bus_type | Integer specifying the bus type; constant values are declared in sys/edt.h, for example ADAP_VME, ADAP_GIO, or ADAP_EISA. |
e_adap | Integer specifying the adapter (bus) number. |
e_ctlr | Value from the VECTOR ctlr= parameter; typically the device minor number. |
e_space | Array of up to three I/O space structures of type iospace_t. |
The difference between pfxinit() and pfxedtinit() is that pfxedtinit() is parameterized with information from the VECTOR line, and is called once for each VECTOR line that is associated with real hardware.
A driver that uses pfxedtinit() needs to save the edt_t information in a data structure. If the driver supports multiple devices--that is, if it can be called for multiple VECTOR statements--it needs to allocate an array or chain of structures, and save new data on each entry.